﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Classes.orders {

    public class AbstractOrder {

        public static const PREFIX:String = "i";
        protected static const SENDER_ID:String = "senderID";
        protected static const RECIPIENT_ID:String = "recipientID";
        protected static const TIME_SENT:String = "timeSent";
        protected static const LAST_TIME_REMINDED:String = "lastTimeReminded";
        protected static const ORDER_TYPE:String = "orderType";
        protected static const ORDER_STATE:String = "orderState";
        protected static const TRANSMISSION_STATUS:String = "transmissionStatus";

        protected var m_params:Object;

        public function AbstractOrder(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Object=null){
            if (_arg5){
                this.m_params = _arg5;
            } else {
                this.m_params = new Object();
            };
            this.setRecipientID(_arg1);
            this.setSenderID(_arg2);
            this.setType(_arg3);
            this.setTransmissionStatus(_arg4);
        }
        public function getTimeSent():uint{
            return (this.m_params[TIME_SENT]);
        }
        public function getLastTimeReminded():uint{
            return (this.m_params[LAST_TIME_REMINDED]);
        }
        public function getType():String{
            return (this.m_params[ORDER_TYPE]);
        }
        public function getState():String{
            return (this.m_params[ORDER_STATE]);
        }
        public function getSenderID():String{
            return (this.m_params[SENDER_ID]);
        }
        public function getRecipientID():String{
            return (this.m_params[RECIPIENT_ID]);
        }
        public function getTransmissionStatus():String{
            return (this.m_params[TRANSMISSION_STATUS]);
        }
        public function getParams():Object{
            return (this.m_params);
        }
        public function setParams(_arg1:Object):void{
            this.m_params = _arg1;
        }
        public function updateOrder(_arg1:Object):void{
            this.m_params = _arg1;
        }
        public function setTimeSent(_arg1:uint):void{
            this.m_params[TIME_SENT] = _arg1;
        }
        public function setLastTimeReminded(_arg1:uint):void{
            this.m_params[LAST_TIME_REMINDED] = _arg1;
        }
        public function setType(_arg1:String):void{
            this.m_params[ORDER_TYPE] = _arg1;
        }
        public function setState(_arg1:String):void{
            this.m_params[ORDER_STATE] = _arg1;
        }
        public function setSenderID(_arg1:String):void{
            if (_arg1.charAt() == PREFIX){
                this.m_params[SENDER_ID] = _arg1.slice(1);
            } else {
                this.m_params[SENDER_ID] = _arg1;
            };
        }
        public function setRecipientID(_arg1:String):void{
            if (_arg1.charAt() == PREFIX){
                this.m_params[RECIPIENT_ID] = _arg1.slice(1);
            } else {
                this.m_params[RECIPIENT_ID] = _arg1;
            };
        }
        public function setTransmissionStatus(_arg1:String):void{
            this.m_params[TRANSMISSION_STATUS] = _arg1;
        }
        public function equals(_arg1:AbstractOrder):Boolean{
            return ((this.getSenderID() == _arg1.getSenderID()));
        }

    }
}//package Classes.orders 
